package casbinRouter

import (
	"github.com/Sir-yuChen/funAnalyse/api"
	"github.com/Sir-yuChen/funAnalyse/global"
	"github.com/Sir-yuChen/funAnalyse/middleware"
	"github.com/gin-gonic/gin"
)

type StockCasbinRoleRouter struct{}

func (co *StockCasbinRoleRouter) StockCasbinRoleApiRouter(Router *gin.RouterGroup) {
	commonJwtRouter := Router.Group(global.ROUTER_GROUP_CASBIN).Use(middleware.JWTAuth()).Use(middleware.CasbinMiddleware())
	api := api.ApiGroupApp.CasbinApiGroup.StockCasbinRoleController
	{
		commonJwtRouter.GET(global.API_CASBIN_ROLE_GET.BasePath, middleware.CheckApiResourcesMiddleware(global.API_CASBIN_ROLE_GET), api.GetStockCasbinRole)
		commonJwtRouter.POST(global.API_CASBIN_ROLE_INSERT.BasePath, middleware.CheckApiResourcesMiddleware(global.API_CASBIN_ROLE_INSERT), api.InsertStockCasbinRole)
		commonJwtRouter.POST(global.API_CASBIN_ROLE_UPDATE.BasePath, middleware.CheckApiResourcesMiddleware(global.API_CASBIN_ROLE_UPDATE), api.UpdateStockCasbinRole)
		commonJwtRouter.GET(global.API_CASBIN_ROLE_DEL.BasePath, middleware.CheckApiResourcesMiddleware(global.API_CASBIN_ROLE_DEL), api.DelStockCasbinRole)
	}
}
